package cn.hh.test.anno;

import cn.hh.annotation.MyAnnotation;
import cn.hh.annotation.MyAnnotation2;
import cn.hh.annotation.MyAnnotation3;

/**
 * @Author huangh
 * @date 2021/11/02
 * @Description: 使用注解
 */
@MyAnnotation(getVale = "annotation on class")
public class Demo {

    @MyAnnotation(getVale = "annotation on field")
    public String name;

    @MyAnnotation(getVale = "annotation on method")
    public void hello(){

    }

    @MyAnnotation()
    public void defaultMethod(){

    }

    @MyAnnotation2("如果只有value且只有一个属性可以省略")
    public void shenglue(){

    }

    @MyAnnotation3(names = {"1", "2"})
    public void MyAnnotation3(){}

    //如果只有1个数组可以省略{}
    @MyAnnotation3(names = "1")
    public void MyAnnotation4(){}
}
